/*
 * Copyright (c) 2006-2021, RT-Thread Development Team
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 * Change Logs:
 * Date           Author       Notes
 * 2021-12-01     xu       the first version
 */
#ifndef APPLICATIONS_TIME_SYNC_TASK_H_
#define APPLICATIONS_TIME_SYNC_TASK_H_

#include <rtthread.h>

struct network_task {
    rt_bool_t running;
    rt_bool_t requesting;
    const char* name;
    rt_mq_t imq;
    rt_mq_t omq;
    rt_sem_t ready;
    rt_sem_t finish;
    rt_thread_t thread;
};

typedef struct network_task* network_task_t;

network_task_t network_task_create(rt_mq_t omq);

rt_bool_t network_task_start(network_task_t context);

rt_bool_t network_task_stop(network_task_t context);

rt_bool_t network_task_destroy(network_task_t context);

rt_bool_t network_task_control(network_task_t context, rt_uint8_t cmd);

#endif /* APPLICATIONS_TIME_SYNC_TASK_H_ */
